define(function(require, exports){
	var util = require('util');
	var app  = require('pubjs');
	var $    = require('jquery');
	var common = require('modules/common');

	var RENDER, FORMAT;

	// 渠道映射表
	var channelMap = app.config('channelMap');

	/**
	 * 表格字段说明
	 */
	function Labels(){
		/**
		 * 列表数据结构
		 * text: {String} 字段显示名字
		 * desc: {String} 字段备注文字
		 * field: {String} 数据字段名称
		 * format: {Function} 字段内容格式化函数 function(val)
		 * render: {Function} Table字段渲染函数 function(index, value, rowData)
		 * type: {String} 子表格图表类型 (sub - 子表格, button - 图表触发按钮, 不触发子表格容器创建和现实)
		 */
		this.config = {
			// 特殊类型字段
			'type_id': {text:LANG('序号'), width:50},
			'type_op': {text:LANG('操作')},
			'type_select': {text:LANG('选择')},

			// 表格图表
			'grid_trend': {
				text:LANG('每日趋势对比'),
				mode:'chart',
				module:'grid/chart.trend',
				colors: ['#FF005F', '#0EC900'],
				series:[
					// {y_field:'clicks', label_field:'hour', group:'date', init:this.formatChartToday}
					{y_field:'impressions', label_field:'trend_key', param:{name:LANG('展示量')}},
					{y_field:'clicks', label_field:'trend_key', param:{name:LANG('点击量')}},
					{y_field:'back_regs', label_field:'trend_key', param:{name:LANG('注册量')}}
				]
			},

			//master二级表格
			'grid_subCustomerReport':{text:LANG('子客户报表'), icon:'uk-icon-user'},


			"UserPremium":{text:LANG("默认明规则"),unit:'%',format:'formatRateSimple'},
			"HiddenPremium":{text:LANG("默认暗规则"),unit:'%',format:'formatRateSimple'},

			"origin_cost":{text:LANG('价格0'),format:'formatCurrencyKeep3'},
			"true_cost":{text:LANG('价格1'),format:'formatCurrencyKeep3'},
			"proxy_cost":{text:LANG("价格2"),format:'formatCurrencyKeep3'},
			"profit":{text:LANG("盈利"),format:'formatCurrencyKeep3'},
			"origin_impressions":{text:LANG("展示量0"),format:'numberFormat'},
			"impressions":{text:LANG("展示量1"),format:'numberFormat'},

			// 二级表格
			'grid_mediaAndAd':{text:LANG("广告位"), icon:'uk-icon-adjust', right: 'subgrid.mediaAndAd'},
			'grid_mediaAndAd_Monitor':{text:LANG("广告位"), icon:'uk-icon-adjust', right: 'subgrid.mediaAndAd_monitor'},
			'grid_mediaAndAd_lite':{text:LANG("媒体&广告位"), icon:'uk-icon-adjust', right: 'subgrid.mediaAndAd'},
			'grid_sweety': {text:LANG('创意包'), icon:'uk-icon-cube', right: 'subgrid.sweety'},
			'grid_whisky': {text:LANG('落地页'), icon:'uk-icon-file-text', right: 'subgrid.whisky'},
			'grid_period':{text:LANG('时段分析'), icon:'uk-icon-clock-o', right: 'subgrid.period'},
			'grid_frequency': {text:LANG('频次对比'), icon:'uk-icon-bar-chart-o', right: 'subgrid.frequency'},
			"grid_region":{text:LANG("地域"), icon:'uk-icon-globe', right: 'subgrid.region'},
			"grid_client":{text:LANG("客户端"), icon:'uk-icon-desktop', right: 'subgrid.client'},
			'grid_product': {text:LANG('产品'), icon:'uk-icon-gear', right: 'subgrid.product'},
			'grid_creative': {text:LANG('创意'), icon:'uk-icon-star', right: 'subgrid.creative'},
			'grid_campaign': {text:LANG('活动'), icon:'uk-icon-folder-open', right: 'subgrid.campaign'},
			'grid_channelCategory': {text:LANG('频道分类'), icon:'uk-icon-folder-open', right: 'subgrid.channelCategory'},
			'grid_channelCategory2': {text:LANG('二级频道分类'), icon:'uk-icon-folder-open', right: 'subgrid.channelCategory'},
			'grid_customer': {text:LANG('客户报表'), icon:'uk-icon-user'},
			'grid_deal_customer': {text:LANG('客户报表'), icon:'uk-icon-user'},
			'grid_spot_customer': {text:LANG('客户报表'), icon:'uk-icon-user'},
			'grid_overview_whisky': {text:LANG('落地页'), icon:'uk-icon-file-text', right: 'subgrid.whisky'},
			'grid_overview_product': {text:LANG('产品'), icon:'uk-icon-gear', right: 'subgrid.product'},
			'grid_overview_creative': {text:LANG('创意'), icon:'uk-icon-star', right: 'subgrid.creative'},
			'grid_overview_campaign': {text:LANG('活动'), icon:'uk-icon-folder-open', right: 'subgrid.campaign'},
			'grid_overview_period':{text:LANG('时段分析'), icon:'uk-icon-clock-o', right: 'subgrid.period'},
			'grid_overview_frequency': {text:LANG('频次对比'), icon:'uk-icon-bar-chart-o', right: 'subgrid.frequency'},
			"grid_overview_region":{text:LANG("地域"), icon:'uk-icon-globe', right: 'subgrid.region'},
			"grid_overview_client":{text:LANG("客户端"), icon:'uk-icon-desktop', right: 'subgrid.client'},

			'grid_amount_period':{text:LANG('时段分析'), icon:'uk-icon-clock-o', right: 'subgrid.period'},
			'grid_amount_channel':{text:LANG('渠道'),mode:'sub'},
			"grid_amount_region":{text:LANG("地域"), icon:'uk-icon-globe', right: 'subgrid.region'},
			'grid_amount_channelCategory': {text:LANG('频道分类'), icon:'uk-icon-folder-open', right: 'subgrid.channelCategory'},

			'grid_people': {text:LANG("人群报表"), icon:'uk-icon-globe', right: 'subgrid.dmpPeopleGrid'},


			// 这里几个配置感觉是以后的旧配置没有用的，待确认
			'grid_mediaDomain': {text:LANG('媒体域名'), mode:'sub'},
			"grid_sweetyCreative":{text:LANG("创意报表"),mode:"sub"},
			"grid_platform":{text:LANG("平台报表"),mode:"sub"},
			'grid_channel':{text:LANG('渠道'),mode:'sub'},
			'grid_ads':{text:LANG('广告位'),mode:'sub'},
			'grid_periodAgent':{text:LANG('时段分析'),mode:'sub'},
			'grid_periodCollect':{text:LANG('时段分析'),mode:'sub'},
			'grid_mediaChannel':{text:LANG('频道'),mode:'sub'},
			'grid_detail':{text:LANG("详情")},
			'grid_media':{text:LANG("媒体报表"),mode:'sub'},
			'grid_mediaAndAdCampaign':{text:LANG("媒体&广告位"),mode:'sub',module:"tab.mediaAndAdCampaign"},
			'grid_pixels':{text:LANG("窗口大小"),mode:'sub'},
			'grid_productAndPlatform':{text:LANG("产品"),mode:'sub',module:"tab.productAndPlatform"},
			// 广告位模块下的活动子表格
			'grid_adSubCampaign': {text:LANG('活动'), mode:'sub', icon:'uk-icon-folder-open'},
			// 管理子表格
			'grid_admin_employee': {text:LANG('员工报表'), mode:'sub', module:'grid/admin.employeeList', icon:'uk-icon-users'},
			'grid_admin_direct': {text:LANG('直客报表'), mode:'sub', icon:'uk-icon-user'},
			'grid_admin_cost': {text:LANG('消费明细'), mode:'sub', icon:'uk-icon-cart-plus'},

			// 运营平台子表格
			'grid_operations_user': {text:LANG('客户'), mode:'sub', icon:'uk-icon-cart-plus'},
			'grid_operations_spot': {text:LANG('广告位'), mode:'sub', icon:'uk-icon-cart-plus'},
			'grid_operations_channel': {text:LANG('渠道'), mode:'sub', icon:'uk-icon-cart-plus'},
			'grid_operations_industry': {text:LANG('行业'), mode:'sub', icon:'uk-icon-cart-plus'},
			'grid_operations_channel_period': {text:LANG('时段分析'), mode:'sub', icon:'uk-icon-cart-plus'},
			'grid_operations_spot_period': {text:LANG('时段分析'), mode:'sub', icon:'uk-icon-cart-plus'},
			'grid_operations_industry_period': {text:LANG('时段分析'), mode:'sub', icon:'uk-icon-cart-plus'},
			'grid_operations_user_period': {text:LANG('时段分析'), mode:'sub', icon:'uk-icon-cart-plus'},

			// 一般字段说明
			'Name':{text:LANG('名称')},
			'_id':{text:LANG('ID')},
			'Description':{text:LANG('描述'), align:'left'},
			'SweetyName': {text:LANG('创意包名称')},
			'SweetySizeLack': {text:LANG('有效尺寸创意')},
			'Status':{text:LANG('状态'), render: 'renderState'},
			'pixelSize':{text:LANG('尺寸'), render: 'renderPixelSize'},
			'FileType':{text:LANG('类型'), format: 'formatFileType'},
			'Type':{text:LANG('物料类型')},
			'AdPageViews':{text:LANG('广告展示次数'), format: 'numberFormat'},
			'AdUniqueVisit':{text:LANG('独立访客'),format: 'numberFormat'},
			'register': {text:LANG('注册量'), format: 'numberFormat'},
			'login': {text:LANG('登录量'), format: 'numberFormat'},
			"pageviews":{text:LANG("广告展示次数"),desc:LANG("页面展示量（Page View），简称PV。指网页被展示次数的累加。"),format: 'numberFormat'},
			"regs":{text:LANG("注册量"),format: 'numberFormat'},
			"reg_rate":{text:LANG("注册率"),unit:'%',format:this.formatRate},
			"logins":{text:LANG("登录量"),format: 'numberFormat'},
			'url':{text:LANG('前端网址')},
			'sitename':{text:LANG('前端网站名称')},
			'campaign_name':{text:LANG('前端广告活动')},
			'product_name':{text:LANG('前端游戏产品')},
			'platform_name':{text:LANG('前端平台名称')},
			'sweety_creative_name':{text:LANG('前端前端创意')},
			'sweety_name':{text:LANG('前端前端创意包')},
			'whisky_creative_name':{text:LANG('前端落地页创意')},
			'source0_id':{text:LANG('前端来源类型')},
			'source0_name':{text:LANG('前端来源类型')},
			'se':{text:LANG('前端搜索引擎')},
			'se_name':{text:LANG('前端搜索引擎')},
			'keyword_name':{text:LANG('前端关键词')},
			'simword':{text:LANG('前端相关关键词')},
			'sim_level':{text:LANG('前端优化难度')},
			'sim_rate':{text:LANG('前端相关度')},
			'searchs':{text:LANG('前端搜索量')},
			'baidu_indexs':{text:LANG('前端百度收录量')},
			'referer_domain_name':{text:LANG('前端来源域名')},
			'referer_url_name':{text:LANG('前端来源页面')},
			'active_visitors':{text:LANG('前端活跃用户')},
			'new_pageviews':{text:LANG('前端新访客PV'),desc:LANG("新访客PV是指新访客产生的网页展示次数。")},
			'country_name':{text:LANG('前端国家')},
			'country_icon':{text:LANG('前端国家图标')},
			'region_name':{text:LANG('前端访客地区')},
			'region_location':{text:LANG('前端访客地区')},
			'city_name':{text:LANG('前端城市')},
			'isp_name':{text:LANG('前端网络接入商')},
			'entrance_url_name':{text:LANG('前端入口页')},
			'resolution':{text:LANG('落地页分辨率')},
			'resolution_name':{text:LANG('落地页分辨率')},
			'resolution_width':{text:LANG('落地页分辨率(宽)')},
			'resolution_height':{text:LANG('落地页分辨率(高)')},
			'pixels':{text:LANG('前端页面像素(万)')},
			// 'pixels_name':{text:LANG('前端页面像素(万)')},
			'language':{text:LANG('语言')},
			'language_name':{text:LANG('语言')},
			'os':{text:LANG('操作系统')},
			'os_name':{text:LANG('操作系统')},
			'os_type':{text:LANG('操作系统类型')},
			'os_type_name':{text:LANG('操作系统类型')},
			'os_version':{text:LANG('操作系统版本')},
			'os_subversion':{text:LANG('操作系统子版本')},
			'online':{text:LANG('前端在线状态')},
			'browser':{text:LANG('浏览器')},
			'browser_name':{text:LANG('浏览器')},
			'browser_type':{text:LANG('浏览器类型')},
			'browser_type_name':{text:LANG('浏览器类型')},
			'browser_version':{text:LANG('浏览器版本')},
			'browser_subversion':{text:LANG('浏览器子版本')},
			'platform_type':{text:LANG('前端平台')},
			'pageviews_per_session':{text:LANG('前端访问深度')},
			'page_url':{text:LANG('前端受访页面')},
			'page_url_name':{text:LANG('前端受访页面')},
			'page_url_title':{text:LANG('前端受访页面标题')},
			'page_domain_name':{text:LANG('前端受访域名')},
			'channel_name':{text:LANG('前端频道名称')},
			'speed':{text:LANG('前端访问速度')},
			'date':{text:LANG('前端日期')},
			'entrance':{text:LANG('前端入口页面')},
			'exit':{text:LANG('前端当前停留')},
			'begintime':{text:LANG('前端上站时间')},
			'endtime':{text:LANG('前端最后访问')},
			'ip':{text:LANG('前端IP地址')},
			'staytime':{text:LANG('前端停留时间')},
			'status':{text:LANG('前端状态')},
			'avg_loadtime':{text:LANG('前端平均加载时间')},
			'avg_staytime':{text:LANG('前端平均停留时间(秒)')},
			'avg_pageviews':{text:LANG('前端平均访问深度')},
			'avg_pagepixels':{text:LANG('平均窗口大小')},
			'utm_campaign_caid':{text:LANG('前端活动ID')},
			'utm_campaign_mzcaid':{text:LANG('前端活动ID')},
			'utm_campaign_name':{text:LANG('前端活动名称')},
			'utm_campaign_starttime':{text:LANG('前端开始时间')},
			'utm_campaign_endtime':{text:LANG('前端结束时间')},
			'utm_spot_spid':{text:LANG('前端广告ID')},
			'utm_spot_mzspid':{text:LANG('前端广告ID')},
			'utm_spot_position':{text:LANG('前端位置')},
			'utm_spot_channel':{text:LANG('前端频道')},
			'utm_spot_website':{text:LANG('前端媒体')},
			'utm_spot_pubid':{text:LANG('前端网站ID')},
			'utm_keyword_kwid':{text:LANG('前端关键词ID')},
			'utm_keyword_mzkwid':{text:LANG('前端关键词ID')},
			'utm_keyword_name':{text:LANG('前端关键词')},
			'utm_keyword_url':{text:LANG('前端URL')},
			'ips':{text:LANG('独立IP数')},
			'sessions':{text:LANG('前端访问次数')},
			'channel_sessions':{text:LANG('前端访问次数')},
			'channel_visitors':{text:LANG('前端独立访客数(UV)')},
			'bounces':{text:LANG('前端跳出次数')},
			'total_pagestay':{text:LANG('前端总停留时间')},
			'total_pagespeed':{text:LANG('前端总加载时间')},
			'pagestay':{text:LANG('前端平均停留时间')},
			'entrances':{text:LANG('前端入口页次数')},
			'exits':{text:LANG('前端出口页次数')},
			'bounce_rate':{text:LANG('前端跳出率'),unit:'%'},
			'reviews':{text:LANG('回访数'),format: 'numberFormat'},
			'reviewslot':{text:LANG('前端访问次数')},
			'reviewslot_name':{text:LANG('前端访问次数')},
			'depth':{text:LANG('前端访问深度')},
			'depth_name':{text:LANG('前端访问深度')},
			'stayslot':{text:LANG('前端停留时间')},
			'stayslot_name':{text:LANG('前端停留时间')},
			'inclick':{text:LANG('前端站内点击')},
			'outclick':{text:LANG('前端站外点击')},
			'stop':{text:LANG('前端静止时间')},
			'input':{text:LANG('前端输入次数')},
			'tag':{text:LANG('前端关键词分组')},
			'client':{text:LANG('前端客户端')},
			'reserve0':{text:LANG('前端注册')},
			'reserve1':{text:LANG('前端邮件验证')},
			'reserve2':{text:LANG('前端订单数')},
			'reserve3':{text:LANG('前端订单金额')},
			'reserve4':{text:LANG('前端订单确认')},
			'over':{text:LANG('前端在线状态')},
			'session':{text:LANG('前端访问人次')},
			'invalid_sessions':{text:LANG('前端无效访问数')},
			'label0_name':{text:LANG('前端按钮名称')},
			'label1_name':{text:LANG('前端统计项1')},
			'label2_name':{text:LANG('前端统计项2')},
			'label3_name':{text:LANG('前端统计项3')},
			'value0_name':{text:LANG('前端点击次数')},
			'value1_name':{text:LANG('前端统计值1')},
			'value2_name':{text:LANG('前端统计值2')},
			'value3_name':{text:LANG('前端统计值3')},
			'def':{text:LANG('前端默认')},
			'traffic':{text:LANG('前端流量指标')},
			'quality':{text:LANG('前端质量指标')},
			'reserve':{text:LANG('前端转化指标')},
			'custom':{text:LANG('前端自定义')},
			'gutm_source_name':{text:LANG('前端广告来源')},
			'gutm_term_name':{text:LANG('前端关键词')},
			'gutm_medium_name':{text:LANG('前端媒体')},
			'gutm_content_name':{text:LANG('前端广告内容')},
			'gutm_campaign_name':{text:LANG('前端广告')},
			'advertise_name':{text:LANG('前端来源分类')},
			'back_url':{text:LANG('落地页网址')},
			'back_sitename':{text:LANG('落地页网站名称')},
			'back_campaign_name':{text:LANG('落地页广告活动')},
			'back_product_name':{text:LANG('落地页游戏产品')},
			'back_platform_name':{text:LANG('落地页平台名称')},
			'back_sweety_creative_name':{text:LANG('落地页前端创意')},
			'back_sweety_name':{text:LANG('落地页前端创意包')},
			'back_whisky_creative_name':{text:LANG('落地页落地页创意')},
			'back_source0_id':{text:LANG('落地页来源类型')},
			'back_source0_name':{text:LANG('落地页来源类型')},
			'back_se':{text:LANG('落地页搜索引擎')},
			'back_se_name':{text:LANG('落地页搜索引擎')},
			'back_keyword_name':{text:LANG('落地页关键词')},
			'back_simword':{text:LANG('落地页相关关键词')},
			'back_sim_level':{text:LANG('落地页优化难度')},
			'back_sim_rate':{text:LANG('落地页相关度')},
			'back_searchs':{text:LANG('落地页搜索量')},
			'back_baidu_indexs':{text:LANG('落地页百度收录量')},
			'back_referer_domain_name':{text:LANG('落地页来源域名')},
			'back_referer_url_name':{text:LANG('落地页来源页面')},
			'back_active_visitors':{text:LANG('落地页活跃用户')},
			'back_country_name':{text:LANG('落地页国家')},
			'back_country_icon':{text:LANG('落地页国家图标')},
			'back_region_name':{text:LANG('落地页访客地区')},
			'back_region_location':{text:LANG('落地页访客地区')},
			'back_city_name':{text:LANG('落地页城市')},
			'back_isp_name':{text:LANG('落地页网络接入商')},
			'back_entrance_url_name':{text:LANG('落地页入口页')},
			'back_resolution':{text:LANG('落地页分辨率')},
			'back_resolution_name':{text:LANG('落地页分辨率')},
			'back_resolution_width':{text:LANG('落地页分辨率(宽)')},
			'back_resolution_height':{text:LANG('落地页分辨率(高)')},
			'back_pixels':{text:LANG('落地页页面像素(万)')},
			'back_pixels_name':{text:LANG('落地页页面像素(万)')},
			'back_language':{text:LANG('落地页语言')},
			'back_language_name':{text:LANG('落地页语言')},
			'back_os':{text:LANG('落地页操作系统')},
			'back_os_name':{text:LANG('落地页操作系统')},
			'back_os_type':{text:LANG('落地页操作系统类型')},
			'back_os_type_name':{text:LANG('落地页操作系统类型')},
			'back_os_version':{text:LANG('落地页操作系统版本')},
			'back_os_subversion':{text:LANG('落地页操作系统子版本')},
			'back_online':{text:LANG('落地页在线状态')},
			'back_browser':{text:LANG('落地页浏览器')},
			'back_browser_name':{text:LANG('落地页浏览器')},
			'back_browser_type':{text:LANG('落地页浏览器类型')},
			'back_browser_type_name':{text:LANG('落地页浏览器类型')},
			'back_browser_version':{text:LANG('落地页浏览器版本')},
			'back_browser_subversion':{text:LANG('落地页浏览器子版本')},
			'back_platform_type':{text:LANG('落地页平台')},
			'back_pageviews_per_session':{text:LANG('落地页访问深度')},
			'back_page_url':{text:LANG('落地页受访页面')},
			'back_page_url_name':{text:LANG('落地页受访页面')},
			'back_page_url_title':{text:LANG('落地页受访页面标题')},
			'back_page_domain_name':{text:LANG('落地页受访域名')},
			'back_channel_name':{text:LANG('落地页频道名称')},
			'back_speed':{text:LANG('落地页访问速度')},
			'back_date':{text:LANG('落地页日期')},
			'back_entrance':{text:LANG('落地页入口页面')},
			'back_exit':{text:LANG('落地页当前停留')},
			'back_begintime':{text:LANG('落地页上站时间')},
			'back_endtime':{text:LANG('落地页最后访问')},
			'back_ip':{text:LANG('落地页IP地址')},
			'back_staytime':{text:LANG('落地页停留时间')},
			'back_status':{text:LANG('落地页状态')},
			'back_avg_pageviews':{text:LANG('落地页平均访问深度')},
			'back_utm_campaign_caid':{text:LANG('落地页活动ID')},
			'back_utm_campaign_mzcaid':{text:LANG('落地页活动ID')},
			'back_utm_campaign_name':{text:LANG('落地页活动名称')},
			'back_utm_campaign_starttime':{text:LANG('落地页开始时间')},
			'back_utm_campaign_endtime':{text:LANG('落地页结束时间')},
			'back_utm_spot_spid':{text:LANG('落地页广告ID')},
			'back_utm_spot_mzspid':{text:LANG('落地页广告ID')},
			'back_utm_spot_position':{text:LANG('落地页位置')},
			'back_utm_spot_channel':{text:LANG('落地页频道')},
			'back_utm_spot_website':{text:LANG('落地页媒体')},
			'back_utm_spot_pubid':{text:LANG('落地页网站ID')},
			'back_utm_keyword_kwid':{text:LANG('落地页关键词ID')},
			'back_utm_keyword_mzkwid':{text:LANG('落地页关键词ID')},
			'back_utm_keyword_name':{text:LANG('落地页关键词')},
			'back_utm_keyword_url':{text:LANG('落地页URL')},
			'back_ips':{text:LANG('落地页IP')},
			'back_channel_sessions':{text:LANG('落地页访问次数')},
			'back_channel_visitors':{text:LANG('落地页独立访客数(UV)')},
			'back_bounces':{text:LANG('落地页跳出次数')},
			'back_total_pagestay':{text:LANG('落地页总停留时间')},
			'back_total_pagespeed':{text:LANG('落地页总加载时间')},
			'back_pagestay':{text:LANG('落地页平均停留时间(秒)')},
			'back_entrances':{text:LANG('落地页入口页次数')},
			'back_exits':{text:LANG('落地页出口页次数')},
			'back_bounce_rate':{text:LANG('落地页跳出率'),unit:'%'},
			'back_reviews':{text:LANG('落地页访问次数')},
			'back_reviewslot':{text:LANG('落地页访问次数')},
			'back_reviewslot_name':{text:LANG('落地页访问次数')},
			'back_depth':{text:LANG('落地页访问深度')},
			'back_depth_name':{text:LANG('落地页访问深度')},
			'back_stayslot':{text:LANG('落地页停留时间')},
			'back_stayslot_name':{text:LANG('落地页停留时间')},
			'back_inclick':{text:LANG('落地页站内点击')},
			'back_outclick':{text:LANG('落地页站外点击')},
			'back_stop':{text:LANG('落地页静止时间')},
			'back_tag':{text:LANG('落地页关键词分组')},
			'back_client':{text:LANG('落地页客户端')},
			'back_reserve0':{text:LANG('落地页注册')},
			'back_reserve1':{text:LANG('落地页邮件验证')},
			'back_reserve2':{text:LANG('落地页订单数')},
			'back_reserve3':{text:LANG('落地页订单金额')},
			'back_reserve4':{text:LANG('落地页订单确认')},
			'back_over':{text:LANG('落地页在线状态')},
			'back_session':{text:LANG('落地页访问人次')},
			'back_invalid_sessions':{text:LANG('落地页无效访问数')},
			'back_label0_name':{text:LANG('落地页按钮名称')},
			'back_label1_name':{text:LANG('落地页统计项1')},
			'back_label2_name':{text:LANG('落地页统计项2')},
			'back_label3_name':{text:LANG('落地页统计项3')},
			'back_value0_name':{text:LANG('落地页点击次数')},
			'back_value1_name':{text:LANG('落地页统计值1')},
			'back_value2_name':{text:LANG('落地页统计值2')},
			'back_value3_name':{text:LANG('落地页统计值3')},
			'back_def':{text:LANG('落地页默认')},
			'back_traffic':{text:LANG('落地页流量指标')},
			'back_quality':{text:LANG('落地页质量指标')},
			'back_reserve':{text:LANG('落地页转化指标')},
			'back_custom':{text:LANG('落地页自定义')},
			'back_gutm_source_name':{text:LANG('落地页广告来源')},
			'back_gutm_term_name':{text:LANG('落地页关键词')},
			'back_gutm_medium_name':{text:LANG('落地页媒体')},
			'back_gutm_content_name':{text:LANG('落地页广告内容')},
			'back_gutm_campaign_name':{text:LANG('落地页广告')},
			'back_advertise_name':{text:LANG('落地页来源分类')},
			"back_old_pageviews":{text:LANG("B_老访客展示量"),desc:LANG("落地页被老访客浏览的次数。<br />B代表落地页（Landing Page）。")},

			// 广告位信息
			'ads_name':{text:LANG('广告位名称'), field:'Name'},
			'ads_size':{text:LANG('尺寸'), render: 'renderPixelSize'},
			'Size':{text:LANG('尺寸'), render: 'renderPixelSize'},
			'ads_price':{text:LANG('参考出价'), field:'BidFloor',format:function(val){return FORMAT.formatCurrency(val/100, false, 2);}},
			'ads_type':{text:LANG('资源类型'), field:'ShowType'},
			'ScreenName':{text:LANG('屏次'), format: 'formatPositionProp', align:'center'},
			'LocQualityName':{text:LANG('资源类型'), format: 'formatPositionProp', align:'center'},
			'AdsPreview':{text:LANG('预览'), format: 'formatPositionPreview', align:'center'},

			"pagepixels":{text:LANG('窗口大小'),format: 'numberFormat'}
			//"avg_click_cost":{text:LANG('CPC(元)'), field:'cpc', desc:LANG("指前端广告每次被点击所消费的费用(CPC=总成本/点击量)"),format:'formatCurrencyKeep2'Keep3},
			//"avg_reg_cost":{text:LANG("CPA(元)"), field:'cpa', desc:LANG("指游戏中的每个注册所消耗的费用(CPA=总成本/注册量)。"),render:this.renderAvgRegCost, format:this.formatAvgRegCost},
			,"CreateTime":{text:LANG("创建时间"),desc:LANG("数据被创建的时间。"),format: 'formatDate',type:'dim',sort:true}
			,"MassMediaName":{text:LANG("媒体"), format: 'formatMediaName'}
			,"MassChannelName":{text:LANG('频道'), format: 'formatMediaName'}
			,"pixels_name":{text:LANG("窗口大小")}

			,'new_bid_num':{text:LANG('当前出价数'),format: 'numberFormat',render: 'filterAgent'}
			,'new_win_num':{text:LANG('当前竞得数'),format: 'numberFormat',render: 'filterAgent'}
			,'new_win_rate':{text:LANG('当前竞得率'),unit:'%',format:this.formatRate,render: 'filterAgent'}
			//,"show_cost":{"text":LANG("价格1"),format:'formatCurrencyKeep2'}
			//,"show_cost_over":{"text":LANG("价格2"),format:'formatCurrencyKeep2'}
			//,"show_cost_over2":{"text":LANG("价格3"),format:'formatCurrencyKeep2'},
			// 广告活动广告位相关
			,'AdxId': {text:LANG("渠道"), type:'fixed'}
			,'adj_price': {text:LANG('溢价'), type:'fixed', sort:false}
			,'top_price': {text:LANG('出价'), type:'fixed', sort:false, align:'right'}
			,'campaign_spot_statue':{text:LANG('状态'), type:'fixed', width:30, align:'center', sort:false}
			,'DomainName':{text:LANG('媒体域名'),field:'referer_domain_name'}
			,'AdvisePrice':{text:LANG('参考出价'),sort:false,format:'formatCurrencyKeep2',render: 'filterAgent'}

			// 带预览图字段
			,'SweetyNameWithThumb': {
				text:LANG('创意包'), name: 'Name', field:'Name', type:'index', width:250,
				render: RENDER.renderThumbName, thumb_type:'sweety'
			}
			,'CreativeNameWithThumb': {
				text:LANG('名称'), name: 'Name', field:'Name', type:'index', width:250,
				render: RENDER.renderThumbName, thumb_type:'creative'
			}
			,'WhiskyNameWithThumb': {
				text:LANG('落地页名称'), name: 'Name', field:'Name', type:'index', width:250,
				render: RENDER.renderThumbName, thumb_type:'whisky'
			}
			,'ProductNameWithThumb': {
				text:LANG('产品'), name: 'Name', field:'Name', type:'index', width:280,
				render: RENDER.renderThumbName, thumb_type:'product'
			}


			//dspuser客户列表
			,'RestAmount':{text:LANG('余额'),sort:false,format:'formatCurrencyKeep2'}
			,'AllowAdCredit':{text:LANG('可用额度'),sort:false,format:'formatCurrencyKeep2'}
			,'yesterday_cost':{text:LANG('昨日消费'),sort:false,format:'formatCurrencyKeep2'},

			// 成本收入报表
			'total_cost': {text: LANG('总成本'), sort: true, format: 'formatCurrencyKeep2'},
			'total_cost_c': {text: LANG('总成本(前一天)'), sort: false, format: 'formatCurrencyKeep2'},
			'total_cost_i': {text: LANG('总成本增长'), sort: false, format: 'numberFormat2'},
			'total_income': {text: LANG('总收入'), sort: true, format: 'formatCurrencyKeep2'},
			'total_income_c': {text: LANG('总收入(前一天)'), sort: false, format: 'formatCurrencyKeep2'},
			'total_income_i': {text: LANG('总收入增长'), sort: false, format: 'numberFormat2'},
			'total_profit': {text: LANG('总利润'), sort: false, format: 'formatCurrencyKeep2'},
			'total_profit_c': {text: LANG('总利润(前一天)'), sort: false, format: 'formatCurrencyKeep2'},
			'total_profit_i': {text: LANG('总利润增长'), sort: false, format: 'numberFormat2'},
			'total_premium_rate': {text: LANG('总溢价率%'), sort: false, format: 'formatRateSimple', align: 'center'},
			'total_premium_rate_c': {text: LANG('总溢价率%(前一天)'), sort: false, format: 'formatRateSimple', align: 'center'},
			'total_premium_rate_i': {text: LANG('总溢价率%增长'), sort: false, format: 'formatRateSimple', align: 'center'},
			'total_profit_rate': {text: LANG('总利润率%'), sort: false, format: 'formatRateSimple', align: 'center'},
			'total_profit_rate_c': {text: LANG('总利润率%(前一天)'), sort: false, format: 'formatRateSimple', align: 'center'},
			'total_profit_rate_i': {text: LANG('总利润率%增长'), sort: false, format: 'formatRateSimple', align: 'center'},
			'rtb_cost': {text: LANG('RTB成本'), sort: true, format: 'formatCurrencyKeep2'},
			'rtb_cost_c': {text: LANG('RTB成本(前一天)'), sort: true, format: 'formatCurrencyKeep2'},
			'rtb_cost_i': {text: LANG('RTB成本增长'), sort: false, format: 'formatCurrencyKeep2'},
			'rtb_income': {text: LANG('RTB收入'), sort: true, format: 'formatCurrencyKeep2'},
			'rtb_income_c': {text: LANG('RTB收入(前一天)'), sort: true, format: 'formatCurrencyKeep2'},
			'rtb_income_i': {text: LANG('RTB收入增长'), sort: false, format: 'formatCurrencyKeep2'},
			'rtb_profit': {text: LANG('RTB利润'), sort: false, format: 'formatCurrencyKeep2'},
			'rtb_profit_c': {text: LANG('RTB利润(前一天)'), sort: false, format: 'formatCurrencyKeep2'},
			'rtb_profit_i': {text: LANG('RTB利润增长'), sort: false, format: 'formatCurrencyKeep2'},
			'rtb_premium_rate': {text: LANG('RTB溢价率%'), sort: false, format: 'formatRateSimple', align: 'center'},
			'rtb_premium_rate_c': {text: LANG('RTB溢价率%(前一天)'), sort: false, format: 'formatRateSimple', align: 'center'},
			'rtb_premium_rate_i': {text: LANG('RTB溢价率%增长'), sort: false, format: 'formatRateSimple', align: 'center'},
			'rtb_profit_rate': {text: LANG('RTB利润率%'), sort: false, format: 'formatRateSimple', align: 'center'},
			'rtb_profit_rate_c': {text: LANG('RTB利润率%(前一天)'), sort: false, format: 'formatRateSimple', align: 'center'},
			'rtb_profit_rate_i': {text: LANG('RTB利润率%增长'), sort: false, format: 'formatRateSimple', align: 'center'},
			'pmp_cost': {text: LANG('PMP成本'), sort: true, format: 'formatCurrencyKeep2'},
			'pmp_cost_c': {text: LANG('PMP成本(前一天)'), sort: true, format: 'formatCurrencyKeep2'},
			'pmp_cost_i': {text: LANG('PMP成本增长'), sort: false, format: 'formatCurrencyKeep2'},
			'pmp_income': {text: LANG('PMP收入'), sort: true, format: 'formatCurrencyKeep2'},
			'pmp_income_c': {text: LANG('PMP收入(前一天)'), sort: true, format: 'formatCurrencyKeep2'},
			'pmp_income_i': {text: LANG('PMP收入增长'), sort: false, format: 'formatCurrencyKeep2'},
			'pmp_profit': {text: LANG('PMP利润'), sort: false, format: 'formatCurrencyKeep2'},
			'pmp_profit_c': {text: LANG('PMP利润(前一天)'), sort: false, format: 'formatCurrencyKeep2'},
			'pmp_profit_i': {text: LANG('PMP利润增长'), sort: false, format: 'formatCurrencyKeep2'},
			'pmp_premium_rate': {text: LANG('PMP溢价率%'), sort: false, format: 'formatRateSimple', align: 'center'},
			'pmp_premium_rate_c': {text: LANG('PMP溢价率%(前一天)'), sort: false, format: 'formatRateSimple', align: 'center'},
			'pmp_premium_rate_i': {text: LANG('PMP溢价率%增长'), sort: false, format: 'formatRateSimple', align: 'center'},
			'pmp_profit_rate': {text: LANG('PMP利润率%'), sort: false, format: 'formatRateSimple', align: 'center'},
			'pmp_profit_rate_c': {text: LANG('PMP利润率%(前一天)'), sort: false, format: 'formatRateSimple', align: 'center'},
			'pmp_profit_rate_i': {text: LANG('PMP利润率%增长'), sort: false, format: 'formatRateSimple', align: 'center'},
			'monitor_cost': {text: LANG('广告监测成本'), sort: true, format: 'formatCurrencyKeep2'},
			'monitor_cost_c': {text: LANG('广告监测成本(前一天)'), sort: true, format: 'formatCurrencyKeep2'},
			'monitor_cost_i': {text: LANG('广告监测成本增长'), sort: false, format: 'formatCurrencyKeep2'},
			'monitor_income': {text: LANG('广告监测收入'), sort: true, format: 'formatCurrencyKeep2'},
			'monitor_income_c': {text: LANG('广告监测收入(前一天)'), sort: true, format: 'formatCurrencyKeep2'},
			'monitor_income_i': {text: LANG('广告监测收入增长'), sort: false, format: 'formatCurrencyKeep2'},
			'monitor_profit': {text: LANG('广告监测利润'), sort: false, format: 'formatCurrencyKeep2'},
			'monitor_profit_c': {text: LANG('广告监测利润(前一天)'), sort: false, format: 'formatCurrencyKeep2'},
			'monitor_profit_i': {text: LANG('广告监测利润增长'), sort: false, format: 'formatCurrencyKeep2'},
			'monitor_premium_rate': {text: LANG('广告监测溢价率%'), sort: false, format: 'formatRateSimple', align: 'center'},
			'monitor_premium_rate_c': {text: LANG('广告监测溢价率%(前一天)'), sort: false, format: 'formatRateSimple', align: 'center'},
			'monitor_premium_rate_i': {text: LANG('广告监测溢价率%增长'), sort: false, format: 'formatRateSimple', align: 'center'},
			'monitor_profit_rate': {text: LANG('广告监测利润率%'), sort: false, format: 'formatRateSimple', align: 'center'},
			'monitor_profit_rate_c': {text: LANG('广告监测利润率%(前一天)'), sort: false, format: 'formatRateSimple', align: 'center'},
			'monitor_profit_rate_i': {text: LANG('广告监测利润率%增长'), sort: false, format: 'formatRateSimple', align: 'center'}
		};
	}

	// var preview_url = app.config('preview_url');
	// var front_base  = app.config('front_base');
	var empty_text  = LANG('<i class="tdef">(空)</i>');
	// var http_proto  = /^(http|https):\/\//i;
	RENDER = {
		filterAgent: function(idx, val, row) {
			return (row.AdChannelId==2 || row.Channel==2) ? '-' : val;
		}
		,filterBidUseRate: function(idx, val, row) {
			if (row.AdChannelId==2 || row.Channel==2){
				return '-';
			}
			// val = row.request_num === 0 ? "" : (row.impressions / row.request_num);
			return FORMAT.formatRate(val);
		}
		,filterWinRate: function(idx, val, row) {
			if (row.AdChannelId==2 || row.Channel==2){
				return '-';
			}
			// val = row.bid_num === 0 ? "" : (row.impressions / row.bid_num);

			return FORMAT.formatRate(Math.min(val, 0.95), 1);
		}
		,renderAvgRegCost: function(id, text, dat) {
			if(dat.back_regs === 0){
				return "-";
			}
			return text;
		}
		,renderThumbName: function(idx, val, row, cfg) {
			var wrap = $('<div class="M-commonColumnWithThumbnail"/>');

			var dom,
				url,			// 预览地址
				statusClass,	// 状态图标样式
				iconTitle;		// 图标说明文字

			switch (cfg.thumb_type){
				case 'creative':			// 创意
					var link = app.config('materialPreview/sweetyCreative');
					url = link.replace('{id}', row._id);

					// 活动下创意包下的创意 @todo ,活动的创意要加上角标；前端发送活动id
					var c = this.config;
					if (c && c.is_sub_grid){
						c = util.parse(c.sub_param, ',', '|');
						if (c.campaign_id){
							// url = util.formatIndex(preview_url, row._id, cfg.thumb_type);
							if(url){
								url = url+'&campaignId='+c.campaign_id;
							}
						}
					}

					// if (!url){
					// 	url = util.formatIndex(preview_url, row._id, cfg.thumb_type);
					// }
					dom = $('<a target="_blank" href="'+url+'" date-index="'+idx+'"/>');
					break;
				case 'sweety':			// 创意包
					// 预览地址 -@todo 等后端
					url = app.config('materialPreview/sweety').replace('{id}', row._id);
					// 状态：启用、暂停、归档
					if ( row.IsDeleted ) {
						statusClass = 'store';
						iconTitle = LANG('归档')
					} else {
						statusClass = (+row.Status===1) ? 'running': 'pause';
						iconTitle = (+row.Status===1) ? LANG('启用'): LANG('暂停');
					}

					dom = $([
						'<span>',
						'<i title="'+iconTitle+'" class=" '+statusClass+' mr5"></i>',
						'<a target="_blank" href="'+url+'" class="" date-index="'+idx+'"/>',
						'</span>'
					].join(''));
					break;
				case 'whisky':			// 落地页
					// Type:1外链；2本地素材
					// 预览地址
					url = row.Preview || app.config('materialPreview/whisky').replace('{id}', row._id);

					// 状态：启用、暂停、归档
					if ( row.IsDeleted ) {
						statusClass = 'store';
						iconTitle = LANG('归档')
					} else {
						statusClass = (+row.Status===1) ? 'running': 'pause';
						iconTitle = (+row.Status===1) ? LANG('启用'): LANG('暂停');
					}

					dom = $([
						'<span>',
						'<i title="'+iconTitle+'" class=" '+statusClass+' mr5"></i>',
						'<a target="_blank" href="'+url+'" class=""/>',
						'</span>'
					].join(''));
					break;
				/* falls through */
				case 'product':
					url = app.config('materialPreview/product').replace('{id}', row._id);
					dom = $('<a/>').attr({
						'target': '_blank',
						'href': url
					});
					break;
				default:
					dom = $('<div/>');
					break;

			}
			if (cfg.width){
				dom.attr('title', LANG(val));
			}

			// a标签
			var a = dom.find('a');
			if(!a.length){
				a = dom;
				if(cfg.width){
					a.width(cfg.width-75);
				}
			}else{
				if(cfg.width){
					a.width(cfg.width-95);
				}
			}
			a.addClass('M-grid-thumb').addClass('text-truncate dib');
			if (val === ''){
				a.html(empty_text);
			}else {
				a.text(LANG(val));
			}

			if(cfg.thumb_type == 'product'){
				if(row.GameId){
					var gameId = row.GameId ? ' (' + row.GameId + ')' : '';
					a.attr('title', LANG(val) + gameId);
					$('<span class="uk-text-muted"/>').text(gameId).appendTo(a);
				}
			}

			// 缩略图
			var h = cfg.thumb_height || cfg.thumb_size || 50,
				w = cfg.thumb_width || cfg.thumb_size || 50
			var thumb;
			if(row.Cover && row.Cover.thumb)
			{
				thumb = row.Cover.thumb;
			}
			else
			{
				thumb = row.Thumb || row.Cover || null;
			}


			var icon  = thumb ? common.imageThumb(thumb, w, h) : null;
			icon = common.loadImage(cfg.thumb_type, icon).appendTo(wrap);

			// @todo 是否要加前缀？
			// if (thumb && !http_proto.test(thumb)){
			// 	thumb = front_base + thumb;
			// }

			icon.attr({'width':w, 'height':h, 'data-origin':thumb});
			icon.css({'width': w, 'height': h});
			icon.addClass('mr5');

			a.css({'line-height': h + 'px'});

			// 绑定事件 -鼠标经过显示弹框缩略大图
			icon.on('mouseenter mouseleave imageLoad imageError', this, _showPreviewImage);
			dom.appendTo(wrap);
			return wrap.width(cfg.width-40);
		}
		,renderState: function(index, val, row) {
			var text, cls = 'stateDisable';
			if (row.IsDraft){
				text = '草稿';
			}else {
				switch (val){
					case -2:
						text = '审核中';
						break;
					case -1:
						text = '未通过';
						break;
					case 1:
						text = '已通过';
						cls = 'stateEnable';
						break;
					case 2:
						text = '已停用';
						break;
					default:
						text = '待审核';
						break;
				}
			}
			return ('<span class="'+cls+'">' + text + '</span>');
		}
		,renderPixelSize: function(index, val, row) {
			if (!row.Width || !row.Height){
				if(row.Size) {
					return Math.floor(row.Size/10000) + '*' + (row.Size % 10000);
				}
				else {
					return '-';
				}
			}else {
				return row.Width + '*' + row.Height;
			}
		},
		renderChannel: function(i, val, row){
			return channelMap[val] || val;
		},
		renderTime: function (i, val, data) {
			return util.date("Y-m-d H:i:s", val);
		}
	};

	FORMAT = {
		/**
		 * 格式化货币。
		 * 保留小数点后2位。
		 * @param  {Number} val  金额
		 * @param  {Bool}   pure 是否返回纯数字
		 * @param  {Number} size <可选> 保留的小数位数, 默认为2
		 * @return {String}      格式化后的字符串
		 * @private
		 * @todo 有谁敢提供个更好的方法么？
		 */
		formatCurrency: function(val, pure, size) {
			if (isNaN(+size)){ size = 2; }
			val = util.round0(val, size);
			return (pure ? '' : pubjs.currSign()) + util.numberFormat(pubjs.currRate(val, size));
		}
		/**
		 * 文件扩展名转换
		 */
		,formatFileType: function(val) {
			return val.toString().toUpperCase();
		}
		/**
		 * 格式化时间
		 * @param  {Number} ms 毫秒
		 * @return {String}    格式化完的数据
		 * @private
		 */
		,formatTime: function(ms) {
			ms = +ms;
			var format = "s.MMM"+LANG("秒");
			if(!isNaN(ms)){
				var sm = new Date();
				sm.setHours(0);
				sm.setMinutes(0);
				sm.setSeconds(0);
				sm.setMilliseconds(ms);
				sm = {
					"h":sm.getHours()
					,"m":sm.getMinutes()
					,"s":sm.getSeconds()
					,"M":sm.getMilliseconds()
				};
				format = format.replace(/(h+|m+|s+|M+)/g,function(v){
					var sv = sm[v.slice(0,v.charAt(0) === v.charAt(1)?1:3)];
					sv = v.length > 1 && v.charAt(0) === v.charAt(1) && sv<10?"0"+sv:sv;
					return sv
				});
				sm = null;
				return format;
			}else{
				return "";
			}
		}
		/**
		 * 日期
		 * @param  {Number} ms 时间戳
		 * @return {String}    格式化完的数据
		 * @private
		 */
		,formatDate: function(ts) {
			return util.date("Y-m-d",ts);
		}
		/**
		 * 格式化百分率
		 * @param  {Float} rate 百分比小数
		 * @param {Number} size <可选> 保留的小数位位数, 默认为3位
		 * @return {String}     格式化完带百分号的数据
		 * @private
		 */
		,formatRate: function(rate, size) {
			if (isNaN(+size)){ size = 3; }
			rate = util.round0(rate * 100, size);
			return util.numberFormat(rate) + '%';
		}
		,formatRateSimple: function(rate, size) {
			if (isNaN(+size)){ size = 3; }
			rate = util.round0(rate, size);
			return util.numberFormat(rate) + '%';
		}
		/**
		 * 格式化媒体名称
		 * @param  {String} val 媒体名称
		 * @return {String}     处理后的媒体名称
		 * @private
		 */
		,formatMediaName: function(val) {
			if(!val){
				val = LANG('<i class="tdef">默认</i>');
			}
			return val;
		}
		,formatPositionProp: function(val) {
			if (val){ return val; }
			return LANG('<i class="tdef">未设置</i>');
		}
		,formatPositionPreview: function(val){
			if (val){
				return '<a href="'+val+'" target="_blank">'+LANG("预览")+'</a>';
			}else {
				return '-';
			}
		}
		,formatCurrencyKeep2: function (val) {
			return FORMAT.formatCurrency(val, false, 2);
		}
		,formatCurrencyKeep3: function (val) {
			return FORMAT.formatCurrency(val, false, 3);
		}
		,formatAvgRegCost: function (val) {
			return FORMAT.formatCurrency(val, false, 2);
		}
		,formatRateKeep1: function(val) {
			return FORMAT.formatRate(val, 1);
		}
		,formatRateKeep2: function(val) {
			return FORMAT.formatRate(val, 2);
		}
		,numberFormat: function(val) {
			return util.numberFormat(val, ',', 3);
		}
		,formatChartToday: function(item, date, config) {
			var today = util.date('Y-m-d');
			if (item.name == today){
				item.name = LANG('今天');
			}else {
				item.name = LANG('昨天');
			}
		}
		,formatCPA: function (val) {
			if(val === 0)
			{
				return "-";
			}
			else
			{
				return FORMAT.formatCurrency(val, false, 2);
			}
		}
		,numberFormat5: function(val) {
			return util.toFixed(val, 5);
		}
		,numberFormat2: function(val) {
			return util.toFixed(val, 2);
		}
	};

	function _showPreviewImage(ev){
		var self = ev.data;
		if(self == window){
			return;
		}
		var tip  = self.get('previewImage');
		var el = $(this);
		switch (ev.type){
			case 'mouseenter':
				//链接地址
				if (el.attr('data-ready') !== '1'){ break; }
				//图片地址
				var href = el.attr('data-origin');
				var img = common.imageThumb(href, 200, 200);
				var html = '<a href='+ href +' target="_blank"><img width="200" src='+ img +'></a>';
				var tipBody;
				// 计算tip显示的位置，如果下方不够现实则在上方显示
				var clientY = ev.clientY;
				var viewport = util.getViewport();
				var h = viewport.height - clientY - 50;
				var pos = 'bm';
				if (h < 250) {
					pos = 'tm';
				}
				//弹出框
				if (!tip){
					tip = self.createAsync('previewImage', '@base/tip.base', {
						'pos': pos,
						'anchor': el,
						'delayHide': 500,
						"autoShow": false,
						"drag": false
					}, function(mod){
						tipBody = mod.getContainer();
						tipBody.html(html);
						mod.show();
					});
				}else {
					tipBody = tip.getContainer();
					tipBody.html(html);
					tip.update({anchor: el, pos: pos});
					tip.show();
				}
			break;
			case 'mouseleave':
				if (tip){ tip.hide(); }
			break;
			case 'imageLoad':
				el.attr('data-ready', '1');
			break;
			case 'imageError':
				el.attr('data-thumb', null);
			break;
		}
	}


	Labels.prototype = {
		get: function(){
			var a = arguments;
			for (var i=0; i<a.length; i++){
				if (this.config.hasOwnProperty(a[i])){
					return this.config[a[i]];
				}
			}
			return {text: LANG(a[0])};
		},
		// 判断文件中是否存在某个配置
		has: function(name){
			if (this.config.hasOwnProperty(name)){
				return true;
			}
			return false;
		}
	};

	$.extend(Labels.prototype, FORMAT, RENDER);
	exports.labels = new Labels();

	/**
	 * 固定格式转换函数
	 */
	exports.format = FORMAT;
});

